using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ProtoplasmAnimationTrigger : MonoBehaviour
{
    private Enemy_Protoplasm enemy => GetComponentInParent<Enemy_Protoplasm>();     //��ȡĸ������еĽű����

    private void AnimationTrigger()
    {
        enemy.AnimationFinishTrigger();         //������ɺ���
    }

    private void AttackTrigger()            //����������
    {
        Collider2D[] colliders = Physics2D.OverlapCircleAll(enemy.attackCheck.position, enemy.attackCheckRadius);

        foreach (var hit in colliders)
        {
            if (hit.GetComponent<Player>() != null)
            {
                PlayerStats target = hit.GetComponent<PlayerStats>();

                enemy.stats.DoDamage(target);

                //hit.GetComponent<Player>().DamageEffect();
            }
        }
    }

    //private void OpenCounterWindow() => enemy.OpenCounterAttackWindow();
    //private void CloseCounterWindow() => enemy.CloseCounterAttackWindow();
}
